Unify deployment tracking and support multiple deployments#677
Merged
EhabY merged 13 commits intocoder:mainfrom Dec 16, 2025
Merged
Unify deployment tracking and support multiple deployments#677EhabY merged 13 commits intocoder:mainfrom
EhabY merged 13 commits intocoder:mainfrom
Conversation
bc9bce5 to
642fd52
Compare
EhabY
commented
Dec 10, 2025
5e83d93 to
46afe7f
Compare
EhabY
commented
Dec 10, 2025
46afe7f to
acf26aa
Compare
code-asher
reviewed
Dec 11, 2025
Collaborator
Author
|
@code-asher I've add tests in the last commit BTW, if you wish I can make it a separate PR 🙏 |
b37031e to
6f307c1
Compare
Member
|
Nah same PR for tests I would say! |
code-asher
approved these changes
Dec 12, 2025
Member
code-asher
left a comment
There was a problem hiding this comment.
Wow tried it out and the cross-window stuff is quite magical. ✨ Really cool!!
Member
|
I love "final final" lol 🤣 |
Collaborator
Author
I'm manifesting hahaha |
This change centralizes deployment state management and enables seamless multi-deployment support. The extension now properly tracks per-deployment credentials, syncs state across VS Code windows, and handles login/logout flows in a unified way. Key changes: Architecture: - Add DeploymentManager to centralize deployment state (url, label, token, user) and coordinate client updates, auth contexts, and workspace refreshes - Add LoginCoordinator to handle login prompts with cross-window detection, preventing duplicate login dialogs when multiple windows need auth - Move deployment types to src/deployment/ module with proper type guards Storage & Auth: - SecretsManager now stores per-deployment credentials using label-based keys (coder.session.<label>) instead of flat sessionToken storage - Add LRU tracking for deployments with automatic cleanup of old credentials - Add migration from legacy flat storage format - Cross-window sync via secrets.onDidChange events - Debug command (coder.debug.listDeployments) for inspecting stored state Commands & Remote: - Commands now use DeploymentManager instead of directly manipulating client - Remote connection uses LoginCoordinator for auth prompts during workspace connections - Remove forceLogout in favor of unified logout through DeploymentManager - CliManager.configure() now called on every remote connection, with secrets storage as the source of truth for credentials WebSocket improvements: - CoderApi now implements Disposable to clean up WebSocket connections - Add setCredentials() method to update host+token atomically, avoiding unnecessary reconnection cycles - Add suspend() support to ReconnectingWebSocket for clean disconnects - Simplify WebSocket fallback logic with cleaner SSE fallback handling Tests: - Update secretsManager tests for new per-deployment API - Add comprehensive reconnectingWebSocket tests for suspend/reconnect - Extend coderApi tests for credential handling
461eae8 to
fae35bd
Compare
2b8f068 to
3e12008
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change centralizes deployment state management and enables seamless multi-deployment support. The extension now properly tracks per-deployment credentials, syncs state across VS Code windows, and handles login/logout flows in a unified way.
Key changes:
Architecture:
DeploymentManagerto centralize deployment state (url,label,token,user) and coordinate extension client updates, auth contexts, and workspace refreshesLoginCoordinatorto handle login prompts with cross-window detection, preventing duplicate login dialogs when multiple windows need authsrc/deployment/module with proper type guardsStorage & Auth:
SecretsManagernow stores per-deployment credentials using label-based keys (coder.session.<label>) instead of flatsessionTokenstoragesecrets.onDidChangeeventscoder.debug.listDeployments) for inspecting stored stateCommands & Remote:
DeploymentManagerinstead of directly manipulating clientLoginCoordinatorfor auth prompts during workspace connectionsCliManager.configure()now called on every remote connection, with secrets storage as the source of truth for credentialsWebSocket improvements:
CoderApinow implements Disposable to clean up WebSocket connectionssetCredentials()method to update host+token atomically, avoiding unnecessary reconnection cyclesdisconnect()support toReconnectingWebSocketfor clean disconnectsTests:
secretsManagertests for new per-deployment APIreconnectingWebSockettests for suspend/reconnectcoderApitests for credential handling